'''
在python 列表中一共有三种copy的方法

第一种:直接赋值:赋值的时候表示两个变量都指向同一个地址
第二种:浅拷贝:只拷贝子对象，相当于浅拷贝的对象和原对象的子对象都指向同一地址，两个子对象改变都会影响另一个的子对象
第三种:深拷贝：会给变量开辟一个新的内存地址，初始值为原变量的值。

变量的copy就是开辟一个新的内存空间
'''
# import copy
# a = "b"
# c = copy.copy(a)
# d = copy.deepcopy(a)
# a = "ob"
# c = 'cb'
# d = "d"
# print(id(a))
#
# print(id(c))
# print(id(d))
# print(a,c,d)
#
# b = 0b1001<<2
# print(bin(b))
# c = 0b1001>>3
# print(c)
import copy
aList = [123, 'xyz', 'zara', 'abc', 'xyz',["12","222"]]
fuzhi = aList
fuzhi[1] = "fuzhi"
qian_alist = copy.copy(aList)
deep_alist = copy.deepcopy(aList)
qian_alist[0] = "pp"
qian_alist[5].append("ooo")
deep_alist.append("deepalist")
print("alist ：",aList)
print("赋值：",fuzhi)
print ("copyList : ", qian_alist)
print("deep_alist:",deep_alist)